package com.jb.repair.util;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import com.jb.repair.R;

/**
 * Created by dell on 2016/4/14.
 */


public class DownAttachmentDialogUtil extends Dialog implements View.OnClickListener {


    private AttachDialogListener listener;

    public DownAttachmentDialogUtil(Context context) {
        super(context);
    }

    public DownAttachmentDialogUtil(Context context, int theme, AttachDialogListener listener) {
        super(context, theme);
        this.listener = listener;
    }

    protected DownAttachmentDialogUtil(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.down_attachment_dialog);
        Button btn_canle = (Button) findViewById(R.id.attach_dialog_canlebtn);
        Button btn_sure = (Button) findViewById(R.id.attach_dialog_surebtn);
        btn_canle.setOnClickListener(this);
        btn_sure.setOnClickListener(this);
        getWindow().setLayout(WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.WRAP_CONTENT);
    }

    public interface AttachDialogListener {
        public void onClick(View v);
    }

    @Override
    public void onClick(View v) {
        listener.onClick(v);
    }
}
